package com.example.win.android_banduyujia.peopleactivity.activity.activity.openactivity.DataActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.RadioButton;

import com.example.win.android_banduyujia.R;
import com.example.win.android_banduyujia.entity.Constants;
import com.example.win.android_banduyujia.peopleactivity.ui.activity.BaseTitleBarActivity;

/**
 * Created by huchun on 2015/8/18.
 */
public class UpdateSexActivity extends BaseTitleBarActivity {
     public static final String  USER_SEX = "UpdateSexActivity.USER_SEX";

     private RadioButton mIagMan, mIagWoman;
     private  int  mUserSex;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.title_base_sex);

        InitTitles();
        InitDatas();
        InitViews();
    }

    private void InitTitles() {
        setTitle(R.string.layout_data_page_edit_view_sex);
        showLeftBackButton();
        setRightTextViewListener(R.string.layout_data_save_button, mSaveSexListener);
    }

    private void InitDatas() {
        mUserSex = getIntent().getIntExtra(USER_SEX, Constants.SEX_MAN);
    }

    private void InitViews() {
         mIagMan = (RadioButton)findViewById(R.id.update_data_checked_woman);
         mIagWoman = (RadioButton)findViewById(R.id.update_data_checked_man);
         refreshViews();
    }

    private View.OnClickListener  mSaveSexListener = new View.OnClickListener(){

        @Override
        public void onClick(View v) {
              saveSex();
        }  };

    private void refreshViews() {
        /*mIagMan.setVisibility(View.GONE);
        mIagWoman.setVisibility(View.GONE);
        switch (mUserSex){
            case Constants.SEX_MAN:
                mIagMan.setVisibility(View.VISIBLE);
                break;
            case Constants.SEX_WOMAN:
                mIagWoman.setVisibility(View.VISIBLE);
                break;
        }*/
    }

    private void saveSex() {

    }
}
